#ifndef PAINTAREA_H
#define PAINTAREA_H

#include <QWidget>
#include <QtNetwork/QUdpSocket>
#include <sys/time.h>
#include <QLabel>
#include <QString>

class PaintArea : public QWidget
{
    Q_OBJECT
public:
    explicit PaintArea(QWidget *parent = nullptr);

    ~PaintArea();

    void paintEvent(QPaintEvent* p);

    void setColors(int index, QColor c);

signals:

private slots:
    void onProcessPendingDatagrams();

private:
    QUdpSocket mUdpSocket;
    QLabel *picLabel;
    QLabel *displayLabel[7];

    QPoint mCenter[7];
    QColor mColors[7];

    struct timeval mLastAlertTime[7];
    bool updateLastAlertTime[7];

    QString mNormalMessage = "normal";
    QString mAlertMessage = "alert";
};

#endif // PAINTAREA_H
